package com.wrs.project.androiddemo.ui;

import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import androidx.activity.ComponentActivity;
import androidx.annotation.Nullable;

import com.wrs.project.androiddemo.R;
import com.wrs.project.module.vlc.view.VLCView;
//import com.wrs.project.module.vlc.MyLibVLC;
//import com.wrs.project.module.vlc.MyMediaPlayer;
//import com.wrs.project.module.vlc.MyVLCVideoLayout;

//import org.videolan.libvlc.LibVLC;
//import org.videolan.libvlc.Media;
//import org.videolan.libvlc.MediaPlayer;
//import org.videolan.libvlc.util.VLCVideoLayout;


import org.videolan.libvlc.LibVLC;

import java.util.ArrayList;

public class MainActivity  extends ComponentActivity  {

    private static final boolean USE_TEXTURE_VIEW = false;
    private static final boolean ENABLE_SUBTITLES = true;

    VLCView vlcView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_main);


        vlcView = findViewById(R.id.vlcView);
        ArrayList<String> options = new ArrayList<>();
        vlcView.setUrl("https://vjs.zencdn.net/v/oceans.mp4", options, true);

//        vlcVideoLayout = findViewById(R.id.vlc);
//        final ArrayList<String> args = new ArrayList<>();
//        libVLC = new LibVLC(this, args);
//
//        mediaPlayer = new MediaPlayer(libVLC);
//        mediaPlayer.setEventListener(this);
//        mediaPlayer.attachViews(vlcVideoLayout, null, ENABLE_SUBTITLES, USE_TEXTURE_VIEW);
//
//        String url = "rtsp://stream.strba.sk:1935/strba/VYHLAD_JAZERO.stream";
//        url = "https://vjs.zencdn.net/v/oceans.mp4";
//        Media media = new Media(libVLC, Uri.parse(url));
//        mediaPlayer.setMedia(media);
//        media.release();
//        mediaPlayer.play();


//mediaPlayer.setAspectRatio("");
//mediaPlayer.setScale((float) 0.1);
//mediaPlayer.setVideoScale(MediaPlayer.ScaleType.SURFACE_2_1);
//mediaPlayer.record("", true);
//mediaPlayer.record(null, false);

    }

    void test() {

    }



}
